Quickbook API icon

Quickbook API

(0 reviews)

Error messages

This page provides information about status codes and error messages returned by the API.

The API returns appropriate HTTP status codes for every request when errors occur, following the HTTP protocol standards.

Policy Violation and Application Error are two types of errors that a client can receive from the API.

Policy Violation


Policy Violation errors are generated when a request is not compliant with one of the security policies configured on top of the API.

These messages have the following format:

{
  "error": "invalid_client",
  "description": "wrong client_id or client_secret"
}

The table below summarizes the most common causes:

StatusReason
403Missing, malformed or invalid Authorization header
400The request message is not compliant with our security policies
429The number of requests exceeded the rate limit

Application Error


Application Errors are returned when the application is not able to process the request.

These messages have the following format:

{
    "status": "400",
    "code": "BAD_REQUEST",
    "type": "Validation Error",
    "time": "2019-05-26T15:36:58+0000",
    "message": "Invalid parameter",
    "description": "The service requested doesn't exist : batmobile",
    "reference_id": "45cd9ea7-0d5c-4c04-ae89-9cad9a3f796d"
}
FieldDescription
statusThe HTTP status code
codeThe textual code associated with the HTTP status (See 'Error Codes' below)
typeThe error type (See 'Error Types' below)
timeThe error timestamp to identify when the error occurred
messageThe generic error message
descriptionThe detailed error description
reference_idThe request Transaction ID used for traceability

Note:

The Transaction ID is also present in the response header x-transaction-id for both successful and failed responses. Please always include it when contacting our support, this will speed up the troubleshooting process.

Error Codes

The following table lists the error codes associated with the HTTP status codes.

Error CodeHTTP Status Code
UNHOUTORIZED401
FORBIDDEN403
BAD_REQUEST400
RESOURCE_NOT_FOUND404
METHOD_NOT_ALLOWED405
NOT_ACCEPTABLE406
CONFLICT409
UNSUPPORTED_MEDIA_TYPE415
INTERNAL_SERVER_ERROR500
BAD_GATEWAY502
BACKEND_ERROR520

Note:

All codes follow the HTTP standards. The only exception is the BACKEND_ERROR, which is returned when a 500 error is returned by the backend system. This is to distinguish between internal errors occurred in the integration platform and internal errors occurred in the backend system.

Error Types

The table below lists the error types returned by the API.

Error TypesDescription
Contract ViolationThe request made is not compliant with the API specification
Validation ErrorAn error occurred trying to validate one or more parameters
System ErrorThe application encountered an unexpected error
Upstream Service ErrorThe application received an error from an upstream service
Connection ErrorA connection failure occurred
Authorization ErrorThe user do not have permission to perform the operation

Examples


400 - Bad Request

The request is malformed or contain invalid data and cannot be processed.

{
    "status": "400",
    "code": "BAD_REQUEST",
    "type": "Validation Error",
    "time": "2019-05-26T11:56:15+0000",
    "message": "Address you have provided cannot be used.",
    "description": "Place not found for provided address",
    "reference_id": "fe37194e-f830-4a3a-8168-3a4c9af6c083"
}

403 - Forbidden

The request has a missing, invalid or malformed Authorization header or the customer is trying to perform a not permitted operation.

{
    "status": "403",
    "code": "FORBIDDEN",
    "type": "Authorization Error",
    "time": "2019-05-26T11:55:35+0000",
    "message": "Service you have provided is not allowed for the current customer.",
    "description": "No code found for service: BikeZone",
    "reference_id": "9a8bfab5-baf6-4684-82f9-ceb5010be996"
}

404 - Resource Not Found

The requested URI doesn't exist or is not mapped in the API.

{
    "status": "404",
    "code": "RESOURCE_NOT_FOUND",
    "type": "Contract Violation",
    "time": "2019-05-25T11:18:42+0000",
    "message": "API contract violation, please check the API documentation",
    "description": "No matching patterns for URI /invalid",
    "reference_id": "390b9842-cddf-42fa-8afc-2baf61b215e1"
}

405 - Method Not Allowed

The request method is known by the server but is not supported by the target resource.

{
    "status": "405",
    "code": "METHOD_NOT_ALLOWED",
    "type": "Contract Violation",
    "time": "2019-05-28T10:56:47+0000",
    "message": "API contract violation, please check the API documentation",
    "description": "The http method GET is not allowed for the resource /quote/time",
    "reference_id": "9d4a8404-2aec-49df-942c-8efa0a186f42"
}

406 - Not Acceptable

The API cannot send a representation of a particular resource with the media type indicated in the Accept header of the request.

{
    "status": "406",
    "code": "NOT_ACCEPTABLE",
    "type": "Contract Violation",
    "time": "2019-05-28T10:58:41+0000",
    "message": "API contract violation, please check the API documentation",
    "description": "The expected media type for method POST and resource /quote/time is application/xml  ",
    "reference_id": "d441a04c-0bd6-468f-bce2-2b84c4621e3d"
}

415 - Unsupported Media Type

The request message is in a format that is not supported by the API for the HTTP method used.

{
    "status": "415",
    "code": "UNSUPPORTED_MEDIA_TYPE",
    "type": "Contract Violation",
    "time": "2019-05-28T10:57:20+0000",
    "message": "API contract violation, please check the API documentation",
    "description": "The media type text/xml is not supported for method POST and resource /quote/time",
    "reference_id": "5805009e-6c13-476a-8c99-2cc7c9cf0dab"
}

500 - Internal Server Error

The API failed to process the request due to a server internal error.

{
  "status": "500",
  "code": "INTERNAL_SERVER_ERROR",
  "type": "System Error",
  "time": "2019-05-25T18:59:16+0100",
  "message": "Unable to fulfil request due to internal error.",
  "reference_id": "3a015fc1-d613-4278-b805-af01658c7034"
}

502 - Bad Gateway

One of the upstream services failed and is not able to process the request.

{
  "status": "502",
  "code": "BAD_GATEWAY",
  "type": "Upstream Service Error",
  "time": "2019-05-26T17:33:57+0100",
  "message": "Upstream service unable to fulfil request.",
  "reference_id": "85883fa7-d483-403b-a3a5-12041560fc7e"
}

504 - Gateway Timeout

The API did not receive a timely response from another service.

{
  "status": "504",
  "code": "GATEWAY_TIMEOUT",
  "type": "Connection Error",
  "time": "2019-05-26T17:31:00+0100",
  "message": "Unable to connect to upstream service.",
  "description": "Request timed out.",
  "reference_id": "e26bfc0c-bcda-4c45-908e-7a98531f66ae"
}

520 - Generic Backend Error

The backend failed to process the request due to a server internal error.

{
    "status": "520",
    "code": "BACKEND_ERROR",
    "type": "Backend Error",
    "message": "Unexpected error occurred during the booking.",
    "time": "2019-05-23T05:34:43+0000",
    "reference_id": "00366495-e705-4caa-82d6-33c84d49f39a"
}

Reviews